package zhaomh.zhlib.mixin;

import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.render.RenderTickCounter;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import zhaomh.zhlib.ZhLib;
import zhaomh.zhlib.events.impl.RenderEvent;

@Mixin(InGameHud.class)
public class RenderMixin {
    @Inject(at = @At("TAIL"), method = "render")
    public void render(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) {
        ZhLib.getGameEventManager().call(new RenderEvent(context));
    }
}
